<?php 
include "includes/session.php";
include "includes/comunes.php";
$sql="select * from veh_vehiculos where VehiculoId=".$_GET['veh_id'];
$ejec=cons_sql_up($sql);
$regAudi=mysql_fetch_array($ejec);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de Gestion Vehicular</title>

<link href="estilos.css" rel="stylesheet" type="text/css" />

<!--libreria jquery central-->
<script src="jquery-ui/js/jquery-1.9.1.js"></script>
<!--fin libreria central-->

<!--Librerias para el combo-->
<script language="JavaScript" type="text/javascript" src="combos/jquery.chainedSelects.js"></script>
<!--fin libreria-->

<!--librerias ui-->
<link href="jquery-ui/css/ui-lightness/jquery-ui-1.10.2.custom.css" rel="stylesheet"/>
<script src="jquery-ui/js/jquery-ui-1.10.2.custom.js"></script>
<!--fin libreria-->
<!--estilo para el scroll-->
<style>
  .ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    /* prevent horizontal scrollbar */
    overflow-x: hidden;
  }
  /* IE 6 doesn't support max-height
   * we use height instead, but this forces the menu to always be this tall
   */
  * html .ui-autocomplete {
    height: 300px;
  }
  </style>
<!--
  fin estilo scroll-->


<script language="JavaScript" type="text/javascript">
$(function()
{


	
//funcion que implementa combos
	$('#tiponov').chainSelect('#tipoman','combomanteniemiento.php',
	{
		before:function (target) //before request hide the target combobox and display the loading message
		{
			$("#loading").css("display","block");
			$(target).css("display","none");
		},
		after:function (target) //after request show the target combobox and hide the loading message
		{
			$("#loading").css("display","none");
			$(target).css("display","inline");
		}
	});

//          funcion que implementa autocompletado de articulos
     
 $( "#fecha" ).datepicker({
         dateFormat: "yy-mm-dd"

      });
	  
	  $( "#fechaV" ).datepicker({
         dateFormat: "yy-mm-dd"

      });




//              funcion para validacion de formularios

             $("#pedido").submit(function () {

                if($("#tipopedido").val() == 0) {
                    alert("Debe ingresar el tipo de pedido");
                    return false;
                }

               
           
          
            
        });

//              fin funcion

//funcion tabs
       $(function() {
             $( "#tabs" ).tabs();
        });
      
$( "#menu" ).menu({position: {at: "left bottom"}});
});
</script>

</head>

<body>

<div class="container">
<?php include "includes/head.php"?>
   <div class="content">
       <div class="tituloprincipal"><img src="img/mantenimiento.jpg" width="25" height="25" border="0"/> Pedido de Mantenimiento Vehiculo<?php echo $_GET['veh_id']?>
          <?php include 'includes/submenu.php';?>  
           </div>
       <form id="pedido" name="pedido" method="POST" enctype="multipart/form-data" action="grabarGestion.php">
       <div class="contenedorpedido">
	   <div id="tabs">
               <ul>
                   <li><a href="#tabs-1">Pedido</a></li>
                  
               </ul>
               <div id="tabs-1">
	   <fieldset>
             <legend><b>Datos de Cabecera</b></legend>
             <table>
                 <tr>
                       <td class="textotablamenuform">Sucursal</td>
                     <td class="textotablamenuform">
					  <input type="hidden" name="veh_id" value="<?php echo $_GET['veh_id']?> "  class="campo_form"/>
                        <select name="sucursal" id="sucursal" class="campo_form" >
                             
                             <?php
							 
							 
                             $ped=obtener_sucursales();
                             while($regPed=mysql_fetch_array($ped)){
							    if ($regAudi['VehiculoSucursal']==$regPed['sucursalId'])
                                       echo "<option value='".utf8_encode($regPed['sucursalId'])."' selected>".utf8_encode($regPed['sucursalNombre'])." (".utf8_encode($regPed['sucursalCodigo']).")</option>";
                                else
										echo "<option value='".utf8_encode($regPed['sucursalId'])."'>".utf8_encode($regPed['sucursalNombre'])." (".utf8_encode($regPed['sucursalCodigo']).")</option>";
                          
								

                             }
							 
							 

                             ?>

                         </select>
                     </td>
                  
					 
					  </tr>
                 <tr>
                   
				    
                     <td class="textotablamenuform">Dominio</td>
                     <td class="textotablamenuform">
                         <input type="text" name="usuario" value="<?php echo $regAudi['VehiculoDominio']?> " disabled class="campo_form"/>
                     </td>
                     <td class="textotablamenuform">Tipo</td>
                     <td class="textotablamenuform"><input type="text" name="usuario" value="<?php echo obtener_tipo_vehiculo($regAudi['VehiculoTipo'])?> " disabled class="campo_form"/></td>
               
				 </tr>
			
                 <tr>
                   <td class="textotablamenuform" colspan="1">Descripcion</td>
                     <td class="textotablamenuform" colspan="4">
					
					  <input type="text" name="respoId" id="respoId" value="<?php echo $regAudi['VehiculoDescripcion']?>" class="campo_form" disabled/>
					 </td>
              </tr>
                </table>
        </fieldset>
	
		
		  <fieldset width="600px">
             <legend><b>Datos del Pedido </b></legend>
             <table >
                 <tr> 
				 <td class="textotablamenuform">Tipo de Mantenimiento</td>
                     <td class="textotablamenuform" colspan="5">
                         <select name="tiponov" id="tiponov" class="campo_form">
                            <option selected value="0">Todos...</option>
                             <?php
                             $ped=obtener_tipo_novedad();
                             while($regPed=mysql_fetch_array($ped)){
                                      echo "<option value='".utf8_encode($regPed['NovId'])."'>".utf8_encode($regPed['NovNombre'])."</option>";
									  }

                             ?>

                         </select>
					</td>
					 </tr>
					  <tr>
					 <td class="textotablamenuform">Sub Tipo Mant.</td>
                     <td class="textotablamenuform">
                         <select name="tipoman" id="tipoman" class="campo_form"></select>
                     </td>
						 </tr>
					  <tr>
                    <!-- <td class="textotablamenuform">Fecha Alta</td>
                     <td class="textotablamenuform">
                        <input type="text" name="fecha" id="fecha" value=" "  class="campo_form"/>
                     </td>-->
					  <td class="textotablamenuform">Prioridad</td>
                     <td class="textotablamenuform">
                       <select name="prio" class="campo_form">
					   <option value="1" selected>Baja</option>
					    <option value="2">Media</option>
						 <option value="3">Alta</option>
					   </select>
                     </td>
					 </tr>
					 <tr> 
					 <td class="textotablamenuform">Observacion</td>
                     <td class="textotablamenuform" colspan="4">
                         <textarea class="textotablamenuform"  name="obs" rows="15" cols="45"></textarea>
						 
						 </td>
                    
					 </tr>
					  <tr>
			   <td class="textotablamenuform" style="text-align: right;" colspan="5">
                         <input type="reset" name="enviar" value="Restablecer"  class="boton_form"/>
                         <input name="submit" id="submit" type="submit" value="Grabar Pedido" class="boton_form"/>
                     </td>
					 </tr>
				
             </table>
        </fieldset>
		

		
          </div> 
		
		  </div> 
       </div>
   </form>
       <div class="clear"></div>
   <br>
   </div>
  <?php include "includes/pie.php"?>
  
</div>
</body>
</html>
